版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/28/2013-11-28-CODE 147 Evaluate Reverse Polish Notation/
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +
, -
, *
, /
.
Each operand may be an integer or another expression.
Some examples:
["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9
["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6
|
|